/**
 * 
 */
package com.orange.handler.impl;

import java.sql.SQLException;
import java.util.Map;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.orange.dbhelp.page.Page;
import com.orange.handler.AuthExportGroupService;
import com.orange.modules.bean.ExpertGroupBean;
import com.orange.modules.dao.AuthExportGroupMapRepository;
import com.orange.modules.dao.AuthGroupRepository;
import com.orange.modules.entity.AuthItem;
import com.orange.modules.entity.expert.AuthExportGroupMap;
import com.orange.modules.entity.expert.AuthGroup;
import com.orange.modules.entity.school.AuthSchool;

/**
 * @author gaogs
 *
 *         2016-11-16
 */
@Service
public class AuthExportGroupServiceImpl implements AuthExportGroupService {

	@Autowired
	private AuthGroupRepository authExportGroupRepository;


	// 创建组、更新组、修改组
	
	@Autowired
	private AuthExportGroupMapRepository authExportGroupMapRepository;
	
	/* (non-Javadoc)
	 * @see com.orange.handler.AuthExportGroupService#saveAuthExportGroupInfo(com.orange.modules.entity.AuthExportGroup)
	 */
	@Override
	public void saveAuthExportGroupInfo(AuthGroup a) {
		authExportGroupRepository.saveAuthExportGroupInfo(a);
	}
	@Override
	public AuthGroup queryAuthExportGroupInfo(String pid) throws SQLException {
		AuthGroup a = authExportGroupRepository.queryAuthGroupInfoById(pid);
		return a;
	}
	@Override
	public void addAuthExportGroupMap(AuthExportGroupMap a) {
		// TODO Auto-generated method stub
		authExportGroupMapRepository.addAuthExportGroupMapInfo(a);
	}
	@Override
	public Page<ExpertGroupBean> queryAuthExportGroupMapInfo(Integer pageNumber,Integer pageSize , Map<String ,String> map)
			throws SQLException {
		// TODO Auto-generated method stub
		Page<ExpertGroupBean> page = authExportGroupMapRepository.queryAuthExportGroupMapInfo(pageNumber,pageSize,map);
		return page;
	}
	@Override
	public List<AuthExportGroupMap> queryAuthExportGroupIdentity()
			throws SQLException {
		List<AuthExportGroupMap> list = authExportGroupMapRepository.queryAuthExportGroupIdentity();
		return list;
	}
	@Override
	public List<AuthExportGroupMap> queryAuthExportGroupExportId()
			throws SQLException {
		// TODO Auto-generated method stub
		List<AuthExportGroupMap> list = authExportGroupMapRepository.queryAuthExportGroupExportId();
		return list;
	}

	// 查询组ID
	@Override
	public AuthGroup queryAuthGroupBySchoolId(String pid) throws SQLException {
		AuthGroup a = authExportGroupRepository.queryAuthGroupBySchoolId(pid);
		return a;
	}


	// 删除组
	@Override
	public void deleteAuhExportGroupInfo(String pid) throws SQLException {
		authExportGroupRepository.deleteAuhExportGroupInfo(pid);
	}

	//分页显示
	@Override
	public Page<AuthGroup> queryAuthGroupPage(Map<String, String> map) throws SQLException {
		Page<AuthGroup> a = authExportGroupRepository.queryAuthGroupPage(map);
		return a;
	}
	/* (non-Javadoc)
	 * @see com.orange.handler.AuthExportGroupService#queryAuthGroupPage_material(java.util.Map)
	 */
	@Override
	public Page<AuthGroup> queryAuthGroupPage_material(Map<String, String> map)
			throws SQLException {
		Page<AuthGroup> page=authExportGroupRepository.queryAuthGroupPage_material(map);
		return page;
	}
	@Override
	public Page<AuthSchool> queryAuthObservationSchool(String expertId,
			Map<String, String> map) throws SQLException {
		Page<AuthSchool> page = authExportGroupMapRepository.queryAuthObservationSchool(expertId, map);
		return page;
	}
	@Override
	public AuthSchool querySchoolIdByExpertId(String expertId)
			throws SQLException {
		AuthSchool as = authExportGroupMapRepository.querySchoolIdByExpertId(expertId);
		return as;
	}
	@Override
	public List<AuthItem> queryAuthmaterialResultBySchoolId(String schoolId)
			throws SQLException {
		List<AuthItem> list = authExportGroupMapRepository.queryAuthmaterialResultBySchoolId(schoolId);
		return list;
	}
	@Override
	public List<AuthExportGroupMap> queryAuthExportGroupExportIdByGroupId(
			String groupId) throws SQLException {
		List<AuthExportGroupMap> list = authExportGroupMapRepository.queryAuthExportGroupExportIdByGroupId(groupId);
		return list;
	}

}
